import request from '@/utils/request'

export function page(pageParam) {
  return request({
    url: '/mall_rbac/menu/page',
    method: 'get',
    params: pageParam
  })
}

export function get(menuId) {
  return request({
    url: '/mall_rbac/menu',
    method: 'get',
    params: {
      menuId
    }
  })
}

export function save(data) {
  return request({
    url: '/mall_rbac/menu',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/mall_rbac/menu',
    method: 'put',
    data
  })
}

export function deleteByIdAndSysType(menuId, sysType) {
  return request({
    url: '/mall_rbac/menu',
    method: 'delete',
    params: {
      menuId, sysType
    }
  })
}


export function listMenu() {
  return request({
    url: '/mall_rbac/menu/list_menu',
    method: 'get'
  })
}

export function listMenuBySysType(sysType) {
  return request({
    url: '/mall_rbac/menu/list_menu_by_sys_type',
    method: 'get',
    params: {
      sysType: sysType
    }
  })
}

export function listWithPermissions() {
  return request({
    url: '/mall_rbac/menu/list_with_permissions',
    method: 'get'
  })
}


